import 'package:flutter/cupertino.dart';
import 'package:flutter_app/appwidget/bottom_sheet_widget.dart';
import 'package:flutter_app/appwidget/draw_widget.dart';
import 'package:flutter_app/appwidget/dropdown_button_widget.dart';
import 'package:flutter_app/appwidget/snack_bar_widget.dart';
import 'package:flutter_app/customwidget/animal/3d_book.dart';
import 'package:flutter_app/customwidget/animal/BaseAnimation.dart';
import 'package:flutter_app/customwidget/animal/animal_widget.dart';
import 'package:flutter_app/customwidget/animal/animated_list.dart';
import 'package:flutter_app/customwidget/animal/scal_alpa_animation.dart';
import 'package:flutter_app/customwidget/animal/transform3d_demo.dart';
import 'package:flutter_app/customwidget/animal/tween_animtaion.dart';
import 'package:flutter_app/customwidget/animal/tweensequence_animation.dart';
import 'package:flutter_app/net_data/entity/ItemList.dart';
import 'package:flutter_app/view/tabbar_ui.dart';
import 'package:flutter_app/view/web_view_page.dart';
import 'package:flutter_app/weight_widget/expand_widget.dart';
import 'package:flutter_app/weight_widget/fiex_widget.dart';
import 'package:flutter_app/weight_widget/spacer_widget.dart';
import 'package:flutter_app/widget/expand/view_custom_moudle.dart';
import 'package:flutter_app/widget/fun/code_scan_page.dart';
import 'package:flutter_app/widget/fun/tabrow_widget.dart';
import 'package:flutter_app/widget/fun/tiktok_widget.dart';

/// 路由封装
class RouteMap {
  ///Map
  static final routes = <String, WidgetBuilder>{
    /****************************功能****************************************/
    '/widget/fun/qrcode': (BuildContext context) => CodeScanPage(text: "二维码扫码"),
    '/widget/fun/tab': (BuildContext context) => CustomTable(text: "TabRow表格"),
    '/widget/fun/tiktok': (BuildContext context) => TiktokWidget(text: "仿抖音"),
    /****************************扩展****************************************/
    '/widget/expand/web': (BuildContext context) =>
        WebViewPage("https://www.baidu.com/", "网页加载"),

    /****************************基础****************************************/
    '/widget/animal/animationcontroller': (BuildContext context) =>
        BaseAnimation(text: "基础核心animationcontroller"),
    '/widget/animal/baseanimation': (BuildContext context) =>
        TweenAnimation(text: "动画核心Tween"),
    '/widget/animal/tweensequenceanimation': (BuildContext context) =>
        TweensequenceAnimation(text: "动画序列Sequence"),
    '/widget/animal/animalwidget': (BuildContext context) =>
        AnimalWidget(text: "动画组件build"),
    '/widget/animal/animatedlist': (BuildContext context) =>
        AnimatedListDemo(text: "列表动画AnimatedList"),
    '/widget/animal/transformdemo': (BuildContext context) =>
        Transform3DDemo(text: "3D效果TransformDemo"),
    '/widget/animal/book3d': (BuildContext context) =>
        Book3DWidget(text: "翻书效果"),
    '/widget/animal/scalalpha': (BuildContext context) =>
        ScalAlpaAnimation(text: "放大渐变动画"),
    '/widget/app/flexible': (BuildContext context) =>
        FiexWidget(text: "权重Flexible"),
    '/widget/app/expanded': (BuildContext context) =>
        ExpandWidget(text: "权重Expanded"),
    '/widget/app/spacer': (BuildContext context) =>
        SpacerWidget(text: "权重Spacer"),


    //////////////////////////App组件/////////////////////////////////////////////////
    '/widget/app/draw': (BuildContext context) =>
        DrawerWidget(text: "抽屉效果Draw"),
    '/widget/app/snackbar': (BuildContext context) =>
        SnackBarWidget(text: "SnackBar"),
    '/widget/app/bottomsheet': (BuildContext context) =>
        BottomSheetWidget(text: "底部弹窗"),
    '/widget/app/dropdownbutton': (BuildContext context) =>
        DropdownButtonWidget(text: "DropdownWidget"),
    '/widget/app/viewmoudel': (BuildContext context) =>
        CustomViewMoudel(text: "ViewMoudel"),

    /****************************扩展****************************************/
    '/widget/expand/tabbar': (BuildContext context) =>
        DataScreen(text: "tabbar防抖动"),
  };

  /// 显示title
  static List<ListItem> getFunItems(BuildContext context) => [
        ListItem("二维码扫码", '/widget/fun/qrcode'),
        ListItem("占位", '/widget/fun/zhanwei'),
        ListItem("TabRow表格", '/widget/fun/tab'),
        ListItem("tiktok抖音", '/widget/fun/tiktok'),
      ];

  /// 扩展
  static List<ListItem> getExpandItems(BuildContext context) => [
        ListItem("网页加载", '/widget/expand/web'),
        ListItem("TabBar滑动", '/widget/expand/tabbar'),
      ];

  /************************************动画***********************************************/

  /// 显示title
  static List<ListItem> getAnimatItems(BuildContext context) => [
        ListItem("Animation\nController", '/widget/animal/animationcontroller'),
        ListItem("动画核心\nTween", '/widget/animal/baseanimation'),
        ListItem("动画序列\nSequence", '/widget/animal/tweensequenceanimation'),
        ListItem("动画组件\nbuild", '/widget/animal/animalwidget'),
        ListItem("列表动画\nAnimated\nList", '/widget/animal/animatedlist'),
        ListItem("3D效果\nTransform\nDemo", '/widget/animal/transformdemo'),
        ListItem("翻书效果\nBook3D\nWidget", '/widget/animal/book3d'),
        ListItem("放大渐变动画", '/widget/animal/scalalpha'),
      ];

  ///app组件
  static List<ListItem> getAppItems(BuildContext context) => [
        ListItem("抽屉Draw", '/widget/app/draw'),
        ListItem("SnackBar", '/widget/app/snackbar'),
        ListItem("BottomSheet", '/widget/app/bottomsheet'),
        ListItem("dropdownbutton", '/widget/app/dropdownbutton'),
        ListItem("view实践", '/widget/app/viewmoudel'),
      ];
  ///app组件
  static List<ListItem> getAppWeights(BuildContext context) => [
        ListItem("Flexible ", '/widget/app/flexible'),
        ListItem("Expanded", '/widget/app/expanded'),
        ListItem("Spacer ", '/widget/app/spacer'),

      ];
}
